Skip to content

fix(auth): narrow alias verification token/alias atomicity containment - #7499

Draft
bokelley wants to merge 1 commit into
conductor/member-email-reconciliation-592from
conductor/alias-verification-atomicity
Draft

bokelley wants to merge 1 commit into
conductor/member-email-reconciliation-592from
conductor/alias-verification-atomicity

Conversation

@bokelley

@bokelley bokelley commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Narrow alias verification token/alias atomicity containment only. Verification holds the token lock through the alias write, ownership/evidence checks, and checked terminal token transition in one PostgreSQL transaction. Pre-commit failures roll back without an independent token reset; successful verified replay validates persisted evidence. The GET expiry update cannot regress a terminal token.

This is a DRAFT stacked on #7463, with base conductor/member-email-reconciliation-592 at cdef5b8e0c2dd45da9cb97cc29261ff654c1c08d. Publication is authorized for this exact reviewed candidate only; human approval and fresh exact-head CI are required. A maintainer review request is not approval. Do not mark ready, merge, enable auto-merge, or deploy on the strength of this Draft.

Scope and release limits:

Immutable candidate:

Item Exact value
Head / published commit 8847fc96d5504dcab4138ccb90bad280f385ea31
Tree 1b403c12f056415c2dd02a7bbbcd0264c841937d
Immediate parent / #7463 head cdef5b8e0c2dd45da9cb97cc29261ff654c1c08d
Parent tree 773728362a530bdf0274e008452cd17368957f9a
Stable patch ID da457a3d55fe35c1410109a56e153ffe347e352b
Head ref conductor/alias-verification-atomicity

Exact commit · Exact parent-to-head diff

Exactly one feature commit and three changed files: 477 insertions, 55 deletions. No reviewed blob was rebased or changed for publication.

File Diff Parent blob Candidate blob
server/src/routes/account-linking.ts +112 / -55 cfcf3a65b0dc11afb9568802aa943b9ca366293e ab283d29b754dd083d31c645a49ef56fbb94e2da
server/tests/integration/alias-verification-atomicity.test.ts +363 / -0 absent 0cef113161f9bed39a9c52e1f67d0f555771098b
server/tests/unit/set-primary-email.test.ts +2 / -0 ac61fc833469e745378a5e4a2baa4bc6f56c5dc3 344a6b1eee24f63f509ac1f9d521d0d4b1ee7fb8

Validation on the unchanged candidate:

Check Evidence
Focused callback/controller 40 real PostgreSQL HTTP tests + 21 unit tests = 61 passed
Email mutation suite 40 passed
Expanded reconciliation selection 271 passed in 17 files
Root unit suite 1,063 passed in 71 files
Complete server unit suite 9,643 passed, 31 existing skips, 616 passing files
Complete integration suite 2,253 passed, 8 opt-in skips; 165 passing + 2 skipped files, 167 distinct files
Integration batches 507 passed / 1 skipped; 543 passed; 661 passed / 7 skipped; 542 passed
Typechecks and guards Production, fixed-trace, and strict typecheck including both changed tests passed; normal commit hooks, dynamic-import, format-identity, state-change, image, migration-number, changeset-scope and whitespace checks passed

Total unit passes are 10,706. Focused/selection runs overlap the full suites and are not added again. Integration skips comprise one opt-in retained-GCS-evidence test and seven opt-in creative-agent comparisons. PostgreSQL 16 validation used disposable local Docker databases on loopback port 55432. The focused suite covers independent-session races and deterministic barriers, same-token replay, competing aliases, legacy state, current credential conflicts, INSERT/UPDATE exceptions and suppressed writes, cardinality tampering, persisted-state trigger tampering, rollback observations, and stale GET expiry. Provider credential methods were mocked and asserted unused.

Diagnosed baseline/harness behavior is retained in the evidence:

  • An initial thread-detail fixture timed out resolving a Slack display name with inherited service credentials. Its unchanged suite passed 21/21 on both exact parent and candidate with those credentials removed. Initial stopped runs were excluded; final broad runs used a restricted environment.
  • A fresh integration shard initially lacked the migrations its first ledger suite assumes CI already applied. After initializing the disposable database, the full shard was rerun.
  • The unrelated private-ledger recovery race intermittently produced persistence_uncertain. Diagnostics captured PostgreSQL SQLSTATE 55P03 at its SHARE ROW EXCLUSIVE table lock with a 250 ms lock budget. This race failure also reproduced on the clean exact parent cdef5b8e0c2dd45da9cb97cc29261ff654c1c08d (tree 773728362a530bdf0274e008452cd17368957f9a). The full initialized batch-3 retry subsequently passed all 36 ledger tests. No ledger code, migration, or test repair is included here.

Independent exact-head review:

PASS for the requested narrow fix. No concrete security or integrity blockers identified.

The separate read-only reviewer /root/security_review verified the exact head/tree/parent/patch and changed blobs, inspected transaction/lock lifecycle and fault/replay paths, and independently checked the actual test logs, all 167 distinct integration files, strict typecheck exit 0, and the exact-parent 55P03 reproduction. The reviewer made no edits or database mutations. This narrow verdict does not establish the broader claims explicitly excluded above, replace human approval, or waive fresh exact-head CI.

Prior local logs and the review are retained in the publication workspace's gitignored .context/: commit-validation.log, alias-focused.log, reconciliation.log, final-integration-results.json, integration-1.log, integration-2.log, integration-3-retry.log, integration-4.log, test-typecheck-result.json, ledger-lock-diagnostic.log, ledger-exact-base.log, ledger-baseline-state.json, and security-review.md. These local results are not a claim that fresh GitHub CI has passed. Existing workflow base-branch filters may omit full build/security jobs on this stacked base; all required fresh exact-head CI remains a release gate.


Open workspace in Conductor

Draft disposition — 2026-10-09

This draft is retained for the stated workstream. Continue on this existing branch; no parallel PR is needed. This disposition does not waive CI, review, migration, or release gates.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant